<template>
	<div>
		<hr />
		<p>son</p>
		<h1>{{ value }}</h1>
		<button @click="changeMsg">改变父组件的数据</button>
	</div>
</template>
<script>
export default {
	name: "",
	components: {},
	data() {
		return {};
	},
	props: ["value"],
	model: {
		prop: "msg666",
		event: "input456",
	},
	// v-model原理
	// props: ["value"],//value为model中prop中定义v-model的值
	// model: {
	// 	prop: "value",//默认值为value，定义接收的属性为value
	// 	event: "input",//定义触发事件名默认值为input
	// },
	mounted() {},
	methods: {
		changeMsg() {
			this.$emit("input", "子组件修改父组件");
		},
	},
};
</script>
<style lang="" scoped></style>
